package com.shsxt.model;

import java.io.Serializable;

import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;

@SuppressWarnings("serial")
public class BaseQuery implements Serializable {
	
	private int page;
	private int limit=10 ;
	private String sort;
	
	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		this.page = page;
	}
	public int getLimit() {
		return limit;
	}
	public void setLimit(int limit) {
		this.limit = limit;
	}
	public String getSort() {
		return sort;
	}
	public void setSort(String sort) {
		this.sort = sort;
	}
	
	/**
	 * 构建分页对象
	 * @return
	 */
	public PageBounds toPageBounds() {
		PageBounds pageBounds = new PageBounds(page, limit, 
				Order.formString(sort));
		return pageBounds;
	}
	
}
